package com.bawei.lizhiyu1228.foot;

import com.bawei.lizhiyu1228.foot.Foot;
import com.bawei.lizhiyu1228.foot.MyContract;
import com.bawei.lizhiyu1228.mvp.p.BasePresenter;

import org.jetbrains.annotations.NotNull;

import io.reactivex.Observer;
import io.reactivex.disposables.Disposable;

/**
 * @author : zhiyu
 * @date : 2021/12/28
 * @content :
 */
public class FootPresenter extends BasePresenter<MyContract.FoodView,MyContract.FoodModel> {
    public FootPresenter(MyContract.FoodView mView, MyContract.FoodModel mModel) {
        super(mView, mModel);
    }

    public void getFood(){
        mModel.foodModel(new Observer<Foot>() {
            @Override
            public void onSubscribe(@NotNull Disposable d) {

            }

            @Override
            public void onNext(@NotNull Foot foot) {
                mView.foodView(foot.getData());
            }

            @Override
            public void onError(@NotNull Throwable e) {

            }

            @Override
            public void onComplete() {

            }
        });

    }
}
